package cn.kennylee.codehub.springmvc.exceptionhandler;

import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.core.Ordered;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 应用业务异常处理类
 * <p>Created on 2025/7/21.</p>
 *
 * @author kennylee
 * @since 0.0.1
 */
@RestControllerAdvice
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
@Slf4j
public class AppBizExceptionHandler implements Ordered {

    @PostConstruct
    public void init() {
        log.info("应用业务异常处理类已初始化");
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
